<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue Card List with Gradient Background</title>
  <!-- 引入 Vue.js -->
  <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
  <style>
    /* 添加一些基本样式 */
    #app {
      font-family: Arial, sans-serif;
      text-align: center;
      margin: 20px;
    }

    ul {
      list-style-type: none;
      padding: 0;
    }

    li {
      margin-bottom: 20px;
      /* 设置渐变背景 */
      background: linear-gradient(to bottom, #b3e0ff, #66b3ff);
      padding: 15px;
      border-radius: 8px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* 标题样式 */
    .card-title {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 8px;
    }

    /* 横线样式 */
    .card-line {
      border-top: 1px solid #ccc;
      margin-top: 8px;
    }
  </style>
</head>
<body>

<div id="app">
  <ul>
    <!-- 使用 v-for 指令循环生成卡片 -->
    <li v-for="card in cards" :key="card.id">
      <!-- 标题 -->
      <div class="card-title">{{ card.title }}</div>
      <!-- 数据内容 -->
      {{ card.content }}
      <!-- 横线 -->
      <div class="card-line"></div>
    </li>
  </ul>
</div>

<script>
// 创建 Vue 实例
new Vue({
  el: '#app',
  data: {
    // 卡片数据
    cards: [
      { id: 1, title: 'Card 1 Title', content: 'Card 1 Content' },
      { id: 2, title: 'Card 2 Title', content: 'Card 2 Content' },
      { id: 3, title: 'Card 3 Title', content: 'Card 3 Content' }
    ]
  }
});
</script>

</body>
</html>
